<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
	<title>Document</title>
	<script>
		window.onload = function() {
			var oBtn = document.getElementById('btn');
			var oDiv = document.getElementById('div01');
			// function fnChange() {
			// 	oDiv.style.width = '200px';
			// 	oDiv.style.height = '200px';
			// 	oDiv.style.background = 'gold';
			// }
			// // fnChange();
			// oBtn.onclick = fnChange;
			

			// 匿名函数
			oBtn.onclick = function() {
				oDiv.style.width = '200px';
				oDiv.style.height = '200px';
				oDiv.style.background = 'gold';
			};
		}
	</script>
</head>
<body>
	<input type="button" value="改变样式" id="btn">
	<div id="div01">DIV$DIV$DIV$DIV$DIV$DIV$DIV</div>
</body>
</html>